from constants import *
from cocos.director import director
from cocos.scene import Scene
from scene_main_menu import *
from scene_galaxy import *

class InterfaceGraphic(object):

    def __init__(self,game):
        print "InterfaceGraphic initialized"
         
        # mantain a reference to the game and all the parts of Cocos2d: director, scenes, etc...
        self.game = game
        self.director = director
        self.director.init(resizable=True,width=SCREEN_WIDTH, height=SCREEN_HEIGHT)
        
    
    def start(self):
        director.run(MainMenuScene(self))
        
        
    ######### FOR DEBUG PURPOSES!!! ###########
    def startNewGame(self):
        # this is a debug shortcut to begin directly in a new game
        # empty the scene stack
        for scene in director.scene_stack:
            director.pop()
        #start a new game and run directly from galaxy screen
        #self.game.newGame(random.randint(0,1000))
        self.game.newGame(999)
        self.galaxyScene = GalaxyScene(self)
        director.run(self.galaxyScene)
    ############################################
